#ifndef _FORT_PLATFORM_H
#define _FORT_PLATFORM_H

#include <system/application.h>
#include <fortium_framework.h>

#include <graphics/colour.h>
//#include <system/d3d11/directX.h>

//#include <graphics/d3d11/renderer_3d_d3d11.h>
//#include <graphics/d3d11/render_target_d3d11.h>

#include <string>

namespace fort
{
	// forward declarations
	//class Renderer3D;
	//class RenderTarget;
	class Mesh;

	class Platform
	{
	public:
		Platform();
		virtual ~Platform();

		virtual bool Update() = 0;
		virtual float GetFrameTime() = 0;
		virtual void PreRender() = 0;
		virtual void PostRender() = 0;
		virtual void Clear() const= 0;
		//virtual Mesh* CreateMesh() const = 0;
		//virtual Renderer3D* CreateRenderer3D() const = 0;

		/// Can only create render targets that are the same size as the screen at the moment
		/// so we can use the same depth buffer for all render targets
		//RenderTarget* CreateRenderTarget() const;

		//virtual Matrix44 PerspectiveProjectionFov(const float fov, const float aspect_ratio, const float near_distance, const float far_distance) const = 0;
		//virtual Matrix44 PerspectiveProjectionFrustum(const float left, const float right, const float top, const float bottom, const float near_distance, const float far_distance) const = 0;
		
		

		inline Int32 Width() const { return width; }
		inline Int32 Height() const { return height; }
		inline const Colour& renderTargetClearColour() const { return render_target_clear_colour; }
		inline void setRenderTargetClearColour(const Colour& colour) { render_target_clear_colour = colour; }
		inline float depthClearValue() const { return depth_clear_value; }
		inline void setDepthClearValue(const float value) { depth_clear_value = value; }
		inline UInt32 stencilClearValue() const { return stencil_clear_value; }
		inline void setStencilClearValue(const UInt32 value) { stencil_clear_value = value; }
		//inline void set_render_target(RenderTarget* render_target) { render_target_ = render_target; }
		//inline RenderTarget* render_target() const { return render_target_; }

	protected:
		inline void setWidth(const Int32 pWidth) { width = pWidth; }
		inline void setHeight(const Int32 pHeight) { height = pHeight; }

	private:
		//virtual RenderTarget* CreateRenderTarget(const Int32 width, const Int32 height) const = 0;

		Int32 width;
		Int32 height;
		Colour render_target_clear_colour;
		float depth_clear_value;
		UInt32 stencil_clear_value;
		//RenderTarget* render_target_;
	};
}

#endif // _FORT_PLATFORM_H